Contents
VBVER Function Reference
Version 1.10 - April 1997
Copyright (C) Karri Software Ltd. 1997.

Contents of VBVER Function Reference

To learn how to use Help, please press F1.

Introduction

Installing and Using

VBVER Function Reference

VBVER Error Codes

Ordering Information

Technical Support

Copyright and Warranty

Trademarks


 Introduction

VBVER.DLL is a Dynamic Link Library containing a set of internal routines for Visual Basic(*) which allows you to interrogate version information in executable files.

This information is impossible to get at with Windows APIs from Visual Basic and comes very useful if you're writing an installation program in Visual Basic, or for checking the version information on any external modules that your own program uses to make sure it'll run properly.

Because of the nature of the calling syntax for Visual Basic internal functions, these routines are extremely easy to use. You also have access to virtually all of the information provided in version information blocks embedded in executables.

A sample application is provided to demonstrate the use of these routines.

(*) See Trademarks


 Installing and Using

Installation:

Copy VBVER.DLL to your Windows System directory or any other directory specified in your PATH statement.

Using:

Include the file VBVER.BAS in your project by using the File/Add File... command in the Visual Basic menu.

You can also run the sample applet which shows you how to use most of the routines.


Function Reference

 VBVER Function Reference

Version String Routines:
VerFileDesc	Returns the File Description
VerFileVersion	Returns the File Version
VerProductVersion	Returns the Product Version
VerProductName	Returns the Product Name
VerCompany	Returns the Company name
VerCopyright	Returns the Copyright statement
VerTrademarks	Returns the Trademarks
VerComments	Returns the Comments string
VerInternalName	Returns the Internal Name of the executable
VerOriginalFileName	Returns the Original File Name of the executable
VerPrivateBuild	Returns the Private Build string
VerSpecialBuild	Returns the Special Build string

Miscellaneous Routines:
VerFileFlags	Returns the state of the executable
VerFileOS	Returns the target operating system for the file
VerFileType	Returns the type of executable
VerFileTypeDrv	Returns the type of device driver the file is
VerFileTypeFnt	Returns the type of font the file is
VerFileTypeVxd	Returns the virtual-device id for the file


 VerFileDesc
Returns the File Description string

Declaration:

Declare Function VerFileDesc$ Lib "VBVER.DLL" (ByVal File$)

Parameters:

File$	Name of the executable.

Return value:

String	The File Description string, if found, in the executable.

Errors:

VBV_ERR_NOT_ENOUGH_MEM

Example:
MsgBox VerFileDesc("C:\WINDOWS\WINFILE.EXE")


 VerFileVersion
Returns the File Version string

Declaration:

Declare Function VerFileVersion$ Lib "VBVER.DLL" (ByVal File$)

Parameters:

File$	Name of the executable.

Return value:

String	The File Version string, if found, in the executable.

Errors:

VBV_ERR_NOT_ENOUGH_MEM

Example:
MsgBox VerFileVersion("C:\WINDOWS\WINFILE.EXE")


 VerProductVersion
Returns the Product Version string

Declaration:

Declare Function VerProductVersion$ Lib "VBVER.DLL" (ByVal File$)

Parameters:

File$	Name of the executable.

Return value:

String	The Product Version string, if found, in the executable.

Errors:

VBV_ERR_NOT_ENOUGH_MEM

Example:
MsgBox VerProductVersion("C:\WINDOWS\WINFILE.EXE")


 VerProductName
Returns the Product Name string

Declaration:

Declare Function VerProductName$ Lib "VBVER.DLL" (ByVal File$)

Parameters:

File$	Name of the executable.

Return value:

String	The Product Name string, if found, in the executable.

Errors:

VBV_ERR_NOT_ENOUGH_MEM

Example:
MsgBox VerProductName("C:\WINDOWS\WINFILE.EXE")


 VerCompany
Returns the Company name

Declaration:

Declare Function VerCompany$ Lib "VBVER.DLL" (ByVal File$)

Parameters:

File$	Name of the executable.

Return value:

String	The Company name, if found, in the executable.

Errors:

VBV_ERR_NOT_ENOUGH_MEM

Example:
MsgBox VerCompany("C:\WINDOWS\WINFILE.EXE")


 VerCopyright
Returns the Copyright string

Declaration:

Declare Function VerCopyright$ Lib "VBVER.DLL" (ByVal File$)

Parameters:

File$	Name of the executable.

Return value:

String	The Copyright string, if found, in the executable.

Errors:

VBV_ERR_NOT_ENOUGH_MEM

Example:
MsgBox VerCopyright("C:\WINDOWS\WINFILE.EXE")


 VerTrademarks
Returns the Trademarks string

Declaration:

Declare Function VerTrademarks$ Lib "VBVER.DLL" (ByVal File$)

Parameters:

File$	Name of the executable.

Return value:

String	The Trademarks string, if found, in the executable.

Errors:

VBV_ERR_NOT_ENOUGH_MEM

Example:
MsgBox VerTrademarks("C:\WINDOWS\WINFILE.EXE")


 VerComments
Returns the Comments string

Declaration:

Declare Function VerComments$ Lib "VBVER.DLL" (ByVal File$)

Parameters:

File$	Name of the executable.

Return value:

String	The Comments string, if found, in the executable.

Errors:

VBV_ERR_NOT_ENOUGH_MEM

Example:
MsgBox VerComments("C:\WINDOWS\WINFILE.EXE")


 VerInternalName
Returns the Internal Name string

Declaration:

Declare Function VerInternalName$ Lib "VBVER.DLL" (ByVal File$)

Parameters:

File$	Name of the executable.

Return value:

String	The Internal Name string, if found, in the executable.

Errors:

VBV_ERR_NOT_ENOUGH_MEM

Example:
MsgBox VerInternalName("C:\WINDOWS\WINFILE.EXE")


 VerOriginalFileName
Returns the Original File Name string

Declaration:

Declare Function VerOriginalFileName$ Lib "VBVER.DLL" (ByVal File$)

Parameters:

File$	Name of the executable.

Return value:

String	The Original File Name string, if found, in the executable.

Errors:

VBV_ERR_NOT_ENOUGH_MEM

Example:
MsgBox VerOriginalFileName("C:\WINDOWS\WINFILE.EXE")


 VerPrivateBuild
Returns the Private Build string

Declaration:

Declare Function VerPrivateBuild$ Lib "VBVER.DLL" (ByVal File$)

Parameters:

File$	Name of the executable.

Return value:

String	The Private Build string, if found, in the executable.

Errors:

VBV_ERR_NOT_ENOUGH_MEM

Example:
MsgBox VerPrivateBuild("C:\WINDOWS\WINFILE.EXE")


 VerSpecialBuild
Returns the Special Build string

Declaration:

Declare Function VerSpecialBuild$ Lib "VBVER.DLL" (ByVal File$)

Parameters:

File$	Name of the executable.

Return value:

String	The Special Build string, if found, in the executable.

Errors:

VBV_ERR_NOT_ENOUGH_MEM

Example:
MsgBox VerSpecialBuild("C:\WINDOWS\WINFILE.EXE")


 VerFileFlags
Returns the file flags of the executable

Declaration:

Declare Function VerFileFlags& Lib "VBVER.DLL" (ByVal File$)

Parameters:

File$	Name of the executable.

Return value:

Long	The file flags, if found, of the executable.

Comments:

The Flags value can be a combination of any of the following:

vffDebug
vffPreRelease
vffPatched
vffPrivateBuild
vffInfoInferred
vffSpecialBuild

Please click on any of the above for more information about each flag.

Example:
Dim vFlags&
vFlags = VerFileFlags("C:\WINDOWS\WINFILE.EXE")


vffDebug (= &H1)

File contains debugging information or is compiled with debugging features enabled.


vffPreRelease (= &H2)

File is a development version, not a commercially released product.


vffPatched (= &H4)

File has been modified and is not identical to the original shipping file of the same version number.


vffPrivateBuild (= &H8)

File was not built using standard release procedures. If this value is given, the file must contain a PrivateBuild string.


vffInfoInferred (= &H10)

File contains a dynamically created version-information resource. Some of the blocks for the resource may be empty or incorrect. This value is not intended to be used in version-information resources created by using the VERSIONINFO statement.


vffSpecialBuild (= &H20)

File was built by the original company using standard release procedures but is a variation of the standard file of the same version number. If this value is given, the file must contain a SpecialBuild string.


 VerFileOS
Returns the target operating system for the executable

Declaration:

Declare Function VerFileOS& Lib "VBVER.DLL" (ByVal File$)

Parameters:

File$	Name of the executable.

Return value:

Long	A value for the target operating system. 0 for unknown.

Comments:

The return value can be one of the following:

vosDOS
vosOS216
vosOS232
vosNT
vosWindows16
vosPM16
vosPM32
vosWindows32
vosDOSWindows16
vosDOSWindows32
vosOS216PM16
vosOS232PM32
vosNTWindows32

Please click on any of the above for more information about each.

Example:
Dim vOS&
vOS = VerFileOS("C:\WINDOWS\WINFILE.EXE")


vosDOS (= &H10000)

File was designed for MS-DOS.


vosOS216 (= &H20000)

File was designed for 16-bit OS/2.


vosOS232 (= &H30000)

File was designed for 32-bit OS/2.


vosNT (= &H40000)

File was designed for Windows NT.


vosWindows16 (= &H1)

File was designed for Windows version 3.0 or later.


vosPM16 (= &H2)

File was designed for 16-bit OS/2 Presentation Manager.


vosPM32 (= &H3)

File was designed for 32-bit OS/2 Presentation Manager.


vosWindows32 (= &H4)

File was designed for 32-bit Windows.


vosDOSWindows16 (= &H10001)

File was designed for Windows version 3.0 or later running with MS-DOS.


vosDOSWindows32 (= &H10004)

File was designed for 32-bit Windows running with MS-DOS.


vosOS216PM16 (= &H20002)

File was designed for 16-bit OS/2 Presentation Manager.


vosOS232PM32 (= &H30003)

File was designed for 32-bit OS/2 Presentation Manager.


vosNTWindows32 (= &H40004)

File was designed for 32-bit Windows running with Windows NT.


 VerFileType
Returns the file type

Declaration:

Declare Function VerFileType& Lib "VBVER.DLL" (ByVal File$)

Parameters:

File$	Name of the executable.

Return value:

Long	A value for the type of executable file. 0 for unknown.

Comments:

The return value can be one of the following:

vftApp
vftDll
vftDrv
vftFnt
vftVxd
vftLib

Please click on any of the above for more information about each.

Example:
Dim vType&
vType = VerFileType("C:\WINDOWS\WINFILE.EXE")


vftApp (= &H1)

File contains an application.


vftDll (= &H2)

File contains a Dynamic Link Library.


vftDrv (= &H3)

File contains a device driver. Use VerFileTypeDrv() to find out more about the driver type.


vftFnt (= &H4)

File contains a font. Use VerFileTypeFnt() to find out more about the font type.


vftVxd (= &H5)

File contains a virtual device. Use VerFileTypeVxd() to find the virtual-device identifier included in the virtual-device control block.


vftLib (= &H7)

File contains a static-link library.


 VerFileTypeDrv
Returns device driver type

Declaration:

Declare Function VerFileTypeDrv& Lib "VBVER.DLL" (ByVal File$)

Parameters:

File$	Name of the executable.

Return value:

Long	A value for the type of driver. 0 for unknown.

Comments:

The return value can be one of the following:

drvPrinter
drvKeyboard
drvLanguage
drvDisplay
drvMouse
drvNetwork
drvSystem
drvInstallable
drvSound
drvComm

Please click on any of the above for more information about each.

Example:
Dim vType&
vType = VerFileTypeDrv("C:\WINDOWS\SYSTEM\SUPERVGA.DRV")


drvPrinter (= &H1)

File contains a printer driver.


drvKeyboard (= &H2)

File contains a keyboard driver.


drvLanguage (= &H3)

File contains a language driver.


drvDisplay (= &H4)

File contains a display driver.


drvMouse (= &H5)

File contains a mouse driver.


drvNetwork (= &H6)

File contains a network driver.


drvSystem (= &H7)

File contains a system driver.


drvInstallable (= &H8)

File contains a installable driver.


drvSound (= &H9)

File contains a sound driver.


drvComm (= &HA)

File contains a communications driver.


 VerFileTypeFnt
Returns font type

Declaration:

Declare Function VerFileTypeFnt& Lib "VBVER.DLL" (ByVal File$)

Parameters:

File$	Name of the executable.

Return value:

Long	A value for the type of font. 0 for unknown.

Comments:

The return value can be one of the following:

fntRaster
fntVector
fntTrueType

Please click on any of the above for more information about each.

Example:
Dim vType&
vType = VerFileTypeFnt("C:\WINDOWS\SYSTEM\COURE.FON")


fntRaster (= &H1)

File contains a raster font.


fntVector (= &H2)

File contains a vector font.


fntTrueType (= &H3)

File contains a TrueType font.


 VerFileTypeVxd
Returns the virtual-device identifier included in the virtual-device control block

Declaration:

Declare Function VerFileTypeVxd& Lib "VBVER.DLL" (ByVal File$)

Parameters:

File$	Name of the virtual device driver.

Return value:

Long	Virtual-device identifier.

Example:
Dim vType&
vType = VerFileTypeVxd("C:\WINDOWS\SYSTEM\VCACHE.386")


 Error Codes

Upon errors, VBVER.DLL sets the Visual Basic internal variable Err to the following values:

VBV_ERR_NOT_ENOUGH_MEM	Memory allocation failure


 Ordering Information

Price:

15 US Dollars

To have your registration added to your CompuServe bill, please GO SWREG and follow the instructions.

Please use the registration ID 15133.

We will send you the registered version (without the intro message box) via Email upon receiving notification from CompuServe.


 Technical Support

In case of problems with the routines or if you have any questions about the product, please contact us via email on 100422,3521. We will answer any queries or fix any bugs that you might have.


Disclaimer

 Copyright and Warranty

VBVER 1.10
Copyright (C) Karri Software Limited 1997

Disclaimer of Warranty

THIS SOFTWARE AND THE ACCOMPANYING FILES ARE SOLD "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.

THE USER MUST ASSUME THE FULL RISK OF USING THIS SOFTWARE.

ANY LIABILITY OF THE SELLER WILL BE LIMITED EXCLUSIVELY TO PRODUCT REPLACEMENT OR REFUND OF THE PURCHASE PRICE WITHIN 90 DAYS OF RECEIPT.


Trademarks

Windows is a registered trademark of Microsoft Corporation.
Windows 3.1, Windows for Workgroups 3.11, Windows 95 and Windows NT are registered trademarks of Microsoft Corporation.
Visual Basic is a trademark of Microsoft Corporation.
OS/2 is a registered trademark of International Business Machines Corporation.